#include "mainwindow.h"
#include <QApplication>
#include <QMessageBox>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    db.setHostName("127.0.0.1");
    db.setPort(3306);
    db.setDatabaseName(Databasename);//数据库名字
    db.setUserName(Username);//用户名
    db.setPassword(Userpasswd);//密码
    bool ok = db.open();
    if(ok){
        QMessageBox::information(NULL,"infor","mysql link success");
    }
    else{
        QMessageBox::information(NULL,"infor","mysql link failed");
    }

    return a.exec();
}
